package com.jjyu.controller;

import com.jjyu.entity.Recommendation;
import com.jjyu.service.RecommendationService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/recommendations")
@Tag(name = "Recommendation Management", description = "APIs for managing recommendations")
public class RecommendationController {

    @Autowired
    private RecommendationService recommendationService;

    @Operation(summary = "Create a new recommendation")
    @PostMapping
    public ResponseEntity<Recommendation> createRecommendation(@RequestBody Recommendation recommendation) {
        return ResponseEntity.ok(recommendationService.createRecommendation(recommendation));
    }
}